package modules.enlist
{
	import framework.view.components.button.StateButtonProxy;
	import framework.view.components.container.RepeaterRenderProxy;
	
	import values.avatar.AvatarTypeValue;
	
	import view.component.window.event.NavigationChangeEvent;
	
	public class EnlistNavRenderProxy extends RepeaterRenderProxy
	{
		public function EnlistNavRenderProxy()
		{
			super();
		}
		
		protected function get btn():StateButtonProxy
		{
			return proxys["btn"];
		}
		//==========================================================================
		//  Overridden methods: ShopNavRenderProxy
		//==========================================================================
		override protected function get proxyMapping():Array
		{
			return [ 
				{ skin:"", classRef: StateButtonProxy, id:"btn", onSelected: selectedHandler }
			];
		}
		
		protected var vo:AvatarTypeValue;
		
		override public function set data(value:*):void
		{
			vo = value;
		}
		
		override public function get data():*
		{
			return vo;
		}
		
		override public function set selected(value:Boolean):void
		{
			btn.selected = value;
		}
		
		override public function get selected():Boolean
		{
			return btn.selected;
		}
		
		private function selectedHandler():void
		{
			var evt:NavigationChangeEvent = new NavigationChangeEvent(NavigationChangeEvent.NAV_CHANGED, true);
			evt.param = vo;
			skin.dispatchEvent(evt);
		}
	}
}